home *** CD-ROM | disk | FTP | other *** search
- Path: sun001.spd.dsccc.com!spd!jmccarty
- From: jmccarty@spd.dsccc.com (Mike McCarty)
- Newsgroups: comp.lang.c
- Subject: Re: Big and little endians
- Date: 16 Feb 1996 00:14:18 GMT
- Organization: DSC Communications Corporation, Plano, Texas USA
- Message-ID: <4g0i8q$pni@sun001.spd.dsccc.com>
- References: <4fuuqq$fpp@due.unit.no>
- NNTP-Posting-Host: aplo139.spd.dsccc.com
-
- In article <4fuuqq$fpp@due.unit.no>, Vidar Moe <vidarm@ibt.unit.no> wrote:
- )What exactly is meant by the terms little-endians and
- )big-endians?
- )
- )Vidar Moe.
-
- This is a non-language related question.
-
- Nevertheless:
-
- A big-endian machine stores the more significant byte of multibyte
- integers in the smaller addresses. The 680x0 family of machines is
- big-endian. Example: 0x12345678 is stored in memory as 0x12, 0x34, 0x56,
- 0x78, in that order, in consecutive bytes.
-
- A little-endian machine stores the more significant byte of multibyte
- integers in the larger addresses. The 80x86 family of machines is
- little-endian. Example: 0x12345678 is stored in memory as 0x78, 0x56,
- 0x34, 0x12, in that order, in consecutive bytes.
-
- Either method works. As with everything, people usually prefer what they
- first learned on. As with everything for which there is no good reason
- to choose between methods, there are religious camps which argue
- interminably over which is better.
-
- Mike
-
- ----
- char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
-
- I don't speak for DSC. <- They make me say that.
-